import request from '@/utils/request'

// 查询合同列表
export function listContarct(query) {
  return request({
    url: '/contarct/contarct/list',
    method: 'get',
    params: query
  })
}

//指定合同内容
export function getContarctInfo(id) {
  return request({
    url: '/contarct/contarct/getAll/'+ id,
    method: 'get'
  })
}

// 查询合同详细
export function getContarct(id) {
  return request({
    url: '/contarct/contarct/getInfo/' + id,
    method: 'get'
  })
}

// 新增合同
export function addContarct(data) {
  return request({
    url: '/contarct/contarct',
    method: 'post',
    data: data
  })
}

// 修改合同
export function updateContarct(data) {
  return request({
    url: '/contarct/contarct',
    method: 'put',
    data: data
  })
}

// 删除合同
export function delContarct(id) {
  return request({
    url: '/contarct/contarct/' + id,
    method: 'delete'
  })
}


//提交合同
export function commitContarct(id) {
  return request({
    url: '/contarct/contarct/commit/' + id,
    method: 'post'
  })
}

//审批合同
export function applyContarct(id) {
  return request({
    url: '/contarct/contarct/confirm/' + id,
    method: 'post'
  })
}


//驳回合同
export function rejectContarct(id,remark) {
  return request({
    url: '/contarct/contarct/reject/' + id +"/" +remark,
    method: 'post'
  })
}

//审批合同
export function contarctDetailForSettle(id) {
  return request({
    url: '/contarct/contarct/settle/' + id,
    method: 'post'
  })
}

//作废合同
export function contarctToVoid(id) {
  return request({
    url: '/contarct/contarct/tovoid/' + id,
    method: 'post'
  })
}


// 查询合同列表
export function daoqiContarct(query) {
  return request({
    url: '/contarct/contarct/daoqiList',
    method: 'get',
    params: query
  })
}

